#ifndef _HARDWARE_ADC_H_
#define _HARDWARE_ADC_H_

#include <avr/io.h>
#include <avr/interrupt.h>

enum ChannelADC { ADC0_ADC, ADC1_ADC, ADC2_ADC, ADC3_ADC, ADC4_ADC,
		  ADC5_ADC, ADC6_ADC, ADC7_ADC, None_ADC, Ground_ADC,
		  V_Source_ADC};
enum GainADC {Gain10TimesADC, Gain200TimesADC, Gain1TimesADC, GainNoneADC};


enum PrescalerHardwareADC {Prescaler2_1_ADC, Prescaler2_2_ADC, 
			   Prescaler4_ADC, Prescaler8_ADC,
			   Prescaler16_ADC, Prescaler32_ADC,
			   Prescaler64_ADC, Prescaler128_ADC};

enum AutoTriggerSourceHardwareADC
{
	FreeRunningMode_ADC,
	AnalogComparator_ADC,
	ExternalInterruptRequest0_ADC,
	Timer0_CompareMatch_ADC,
	Timer0_Overflow_ADC,
	Timer1_CompareMatchB_ADC,
	Timer1_Overflow_ADC,
	Timer1_CaptureEvent_ADC
};

enum VoltageReferenceHardwareADC {AREF_SEL_VREF_OFF_ADC, 						AVCC_CAP_AT_AREF_ADC,
				  	RESERVED_ADC,
					INTERNAL_2_56_VOLT_REF_ADC
				};

class ADC
{
	public:

		void setVoltageReference(unsigned char flag);

		void setLeftAdjust(unsigned char flag);

		void setAnalogChannelAndGain(unsigned char input, 
				unsigned char pos, unsigned char neg, 
				unsigned char gain);

		void setInterrupt(unsigned char flag);

		void setStartConversion(unsigned char flag);

		void setAutoTrigger(unsigned char flag);

		void setEnable(unsigned char flag);

		void setPrescaler(unsigned char flag);

		void setAutoTriggerSource(unsigned char flag);

		void getData(volatile unsigned char* upperBit, 
				volatile unsigned char* lowerBit);
};


#endif
